<script type="text/javascript">
$(function(){
	$.post("cancelRefund/getRefundRegisterInfo",function(json){
		if(json.statusCode==DWZ.statusCode.ok){
			$("input[name='customerName']").val(json.refundInfo.customerName);
			$("input[name='paperTypeName']").val(json.refundInfo.paperTypeName)
			$("input[name='paperNo']").val(json.refundInfo.paperNo)
			$("input[name='citizenCardNo']").val(json.refundInfo.citizenCardNo)
			$("input[name='cardpName']").val(json.refundInfo.cardpCodeName)
			$("input[name='cardTypeName']").val(json.refundInfo.cardTypeName)
			$("input[name='logoutDate']").val(getDate(json.refundInfo.logoutDate))
			$("input[name='cardStatusName']").val(json.refundInfo.cardStatusName)
			var list=json.list;
			var content;
			//debugger
			if(list.length==0){
				content+="<tr><td colspan='5' align='center' >未查询到数据</td></tr>"
			}else{
				var flag=false;
				var sumdeposit=0;
				for(var i=0;i<list.length;i++){
					var value;
					if(!flag){
						if(list[i].isDeposit=="N"){
							flag=true;
						}
					}
					var balance=""
					if(list[i].appFlag=="M1Bk"){
						$("input[name='balance']").val()
						balance=list[i].balance;
						if(parseInt(balance)>0){
							sumdeposit+=parseInt(balance);
						}else{
							sumdeposit-=parseInt(balance);
						}
						
						$("input[name='balance']").val(balance);
					}
					var appStatus=list[i].appStatus=='0'?'关闭':'开通';
					var isDeposit=list[i].isDeposit=='N'?'未退':'已退';
					sumdeposit+=parseInt(list[i].deposit)
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td>"+
					list[i].appName+"</td><td>"+list[i].appKindName+"</td><td>"+appStatus+"</td><td>"+balance+"</td><td>"+list[i].deposit+"</td><td>"+
					isDeposit+"</td></tr>"
				}
				$("#tobodyByRefundRegister").html(content)
				$("input[name='sumDeposit']").val(sumdeposit.toFixed(2))
				if(!flag){
					$("#submitByRefundRegister").attr("disabled","disabled")
				}
				var $p = $("#ByRefundRegister");
				initUI($p);
				
			}
		}else{
			navTabAjaxDone(json)
		}
	},"json")
})
</script>
<div class="pageContent">
	<form id="commitRefundInfo" method="post" action="cancelRefund/commitRefundInfo" class="required-validate" onsubmit="return validateCallback(this,printViewPageAjaxDone);">
		<div class="pageFormContent" layoutH="106">
			<fieldset>
			<legend>个人信息</legend>
			
			<p>
				<label>姓名：</label>
				<input  type="text" class="" size="30"name="customerName" readonly="readonly" />		
			</p>
			<p>
				<label>证件类型：</label>
				<input type="text"   name="paperTypeName" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>证件号码：</label>
				<input name="paperNo" class="" type="text" size="30" readonly="readonly" />
			</p>
			</fieldset>
				
			<fieldset>
			<legend>卡信息</legend>
			<p>
				<label>市民卡号：</label>
				<input  name="citizenCardNo" type="text" size="30" readonly="readonly"/>
			</p> 
			<p>
				<label>卡产品：</label>
				<input  name="cardpName" type="text" size="30" readonly="readonly"/>
			</p> 
			<p>
				<label>卡类型：</label>
				<input  name="cardTypeName" type="text" size="30" readonly="readonly"/>
			</p>
			
			<p>
				<label>卡状态：</label>
				<input name="cardStatusName" type="text" size="30"  readonly="readonly"/>
			</p>
			<p>
				<label>注销日期：</label>
				<input name="logoutDate" type="text" size="30"  readonly="readonly"/>
			</p>
			<p>
				<label>退款总额：</label>
				<input name="balance" type="hidden" value="10">
				<input name="sumDeposit" type="text" size="30"  readonly="readonly"/>
			</p>
			</fieldset>
			
			<fieldset>
			<legend>卡应用信息</legend>
				<div id="ByRefundRegister">
					<table class="table" width="100%" layoutH="698">
						<thead>
							<tr align="center">
								<th width="10%" >应用名</th>
								<th width="10%" >应用大类</th>
								<th width="10%" >应用状态</th>
								<th width="6%" >余额(自行车)</th>
								<th width="6%" >应用押金</th>
								<th width="6%" >押金是否退还</th>
							</tr>
						</thead>
						<tbody id="tobodyByRefundRegister">
							
						</tbody>
					</table>
				</div>
			</fieldset>
			<div class="pageFormContent">
				 <div class="formBar">
					<ul> 
						<li>
							<div class="buttonActive" >
								<div class="buttonContent" ><button id="submitByRefundRegister" type="submit">提交信息</button></div>	
							</div>
						</li>
					</ul>
				</div> 	
		</div>
		</div>
	</form>
</div>
